import 'package:flutter/material.dart';
import 'package:ost_flutter_module/widget/custom_widget/custome_divider.dart';
import 'package:ost_flutter_module/widget/custom_widget/custome_list_tile.dart';
import 'package:ost_flutter_module/widget/custom_widget/custome_radius_container.dart';

class DynamicCellMulListTileInfo extends StatelessWidget {
  final List<String> list;
  final List<Widget> svgs;
  final String trailText;
  final bool shadow;
  final Function(dynamic, int) onTap;

  const DynamicCellMulListTileInfo(
      {Key key,
      this.list,
      this.onTap,
      this.shadow = false,
      this.svgs,
      this.trailText})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GContainer(
      onTap: null,
      shadow: shadow,
      child: ListView.separated(
        shrinkWrap: true,
        physics: NeverScrollableScrollPhysics(),
        itemCount: list.length,
        itemBuilder: (BuildContext context, int index) {
          var model = list[index];
          return GListTile(
            leading: svgs == null ? null : svgs[index],
            text: model,
            trailText: trailText ?? '-￥150',
            enable: true,
            onTap: (data) {
              onTap(data, index);
            },
          );
        },
        separatorBuilder: (BuildContext context, int index) {
          return GDivider();
        },
      ),
    );
  }
}
